<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@taglib prefix="s" uri="/struts-tags"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>
<link rel="stylesheet" href="css/login.css" type="text/css">
<script type="text/javascript" src="jquery.validate-1.13.1.js"></script>
<script type="text/javascript" src="js/onload.js"></script>
<script type="text/javascript" src="js/validator.js"></script>

</head>
<body>
	<div
		style="width: 970px;height: 20px;margin-top: 10px;margin-left: 170px;"></div>
	<div class="flat-form" style="float: left;">
		<ul class="tabs">
			<li><a href="javascript:void(0);" class="active">用户登录</a>
			</li>
			<li><a href="javascript:void(0);" id="com">商家登录</a>
			</li>
		</ul>
		<s:if test="#session.user==null&&#session.company==null">
			<div id="user_login" class="form-action" style="display: block">
				<form id="userLoginForm" action="user_login.action" method="post">
					<div id=messageBox1 class="messageBox">
						<s:if test="#session.message!=null">
							<font color="red">${message}</font>
						</s:if>
					</div>
					<ul>
						<li>用户名:<input type="text" id="userName" name="user.userName"
							placeholder="请输入用户名" />
						</li>
						<li>密&nbsp;&nbsp;&nbsp;&nbsp;码:<input type="password"
							name="user.userPassword" placeholder="请输入8-20位密码" />
						</li>
						<li><a href="user_register.jsp">注册</a> <!-- <a href="#">忘记密码</a> --> <input
							type="submit" value="登录" class="button" />
						</li>
					</ul>
				</form>
			</div>
			<div id="company_login" class="form-action" style="display: none">
				<form action="company_login.action" id="companyLoginForm"
					action="company_login.action" method="post">
					<div id=messageBox2 class="messageBox">
					<s:if test="#session.message!=null">
							<font color="red">${message}</font>
						</s:if>
					</div>
					<ul>
						<li>商家名:<input type="text" id="companyName"
							name="company.companyName" placeholder="请输入商家名" />
						</li>
						<li>密&nbsp;&nbsp;&nbsp;&nbsp;码:<input type="password"
							name="company.companyPassword" placeholder="请输入8-20位密码" />
						</li>
						<li><a href="company_register.jsp">注册</a><!--  <a href="#">忘记密码</a> -->
							<input type="submit" value="登录" class="button" />
						</li>
					</ul>
				</form>
			</div>
		</s:if>
		<s:else>

			<div class="welcome" style="display: block">
				<s:if test="#session.user!=null">
					<ul>
						<li>欢迎</li>
						<li>用户名:${sessionScope.user.userName}</li>
						<li>可用信用值:${sessionScope.user.creditPoint}</li>
						<li><a href="user_quit.action" class="quit">退出</a></li>
					</ul>
				</s:if>
				<s:if test="#session.company!=null">
					<ul>
						<li>欢迎</li>
						<li>商家名:${sessionScope.company.companyName}</li>
						<li>联系电话:${sessionScope.company.companyTel}</li>
						<li>负责人:${sessionScope.company.companyManager}</li>
						<li>商家地址:${sessionScope.company.companyAddress}</li>
						<li>已获取信用值:${sessionScope.company.creditPoint}</li>
						<li><a href="company_quit.action" class="quit">退出</a></li>
					</ul>
				</s:if>
			</div>
		</s:else>
	</div>
	<c:remove var="message" scope="session" />
</body>
</html>
